package com.panshi.service.impl;

import com.panshi.vo.PageSizeVO;
import com.panshi.mapper.ArticlrMapper;
import com.panshi.service.ArticlrService;

import com.panshi.vo.ArticlrVO;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestBody;

import javax.annotation.Resource;
import java.util.List;
@Service
public class ArticlrServiceImpl implements ArticlrService {

    @Resource
    private ArticlrMapper artclrMapper;

    @Override
   // @Cacheable(value = "personalart",key = "#root.methodName+#pageSizeVO.startIndex")
    public List<ArticlrVO> findArtQuery(@RequestBody PageSizeVO pageSizeVO) {
        pageSizeVO.setStartIndex(pageSizeVO.getStartIndexInfo());
        return artclrMapper.findArtQuery(pageSizeVO);
    }

    @Override
    //@Cacheable(value = "personalart",key = "#root.methodName+#pageSizeVO.startIndex")
    public List<ArticlrVO> findArttQuery(PageSizeVO pageSizeVO)
    {
        return artclrMapper.findArttQuery(pageSizeVO);
    }

    @Override
    public void deleteArtNo(int aid) {
        artclrMapper.deleteArtNo(aid);
    }

    @Override
    public Integer queryarticlecount(int uid) {
        return artclrMapper.queryarticlecount(uid);
    }

    @Override
    public Integer queryarticlenocount(int uid) {
        return artclrMapper.queryarticlenocount(uid);
    }


    @Override
   // @CacheEvict(value="personalart",allEntries=true)
    public void deleteArt(int aid) {
        artclrMapper.deleteArt(aid);
    }
}
